Skip to content

Part 2 of plugin refactor#377

Merged
ppinchuk merged 22 commits intomainfrom
pp/ordinance_plugin
Feb 7, 2026
Merged

Part 2 of plugin refactor#377
ppinchuk merged 22 commits intomainfrom
pp/ordinance_plugin

Conversation

@ppinchuk
Copy link
Collaborator

@ppinchuk ppinchuk commented Feb 7, 2026

Generalized plugin classes a little bit as well as add prompt-driven plugin implementations. Also added a plugin registry.
This PR brings us about 90% of the way to the full plugin architecture. We are now also in a position where we can easily implement 1-shot extraction

@ppinchuk ppinchuk self-assigned this Feb 7, 2026
Copilot AI review requested due to automatic review settings February 7, 2026 05:16
@ppinchuk ppinchuk requested a review from castelao as a code owner February 7, 2026 05:16
@ppinchuk ppinchuk added enhancement Update to logic or general code improvements p-critical Priority: critical refactor Code improvements that do not change functionality topic-python-general Issues/pull requests related to python labels Feb 7, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 60.64690% with 146 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.03%. Comparing base (be35823) to head (fe22287).

Files with missing lines Patch % Lines
compass/plugin/ordinance.py 50.22% 100 Missing and 11 partials ⚠️
compass/plugin/interface.py 39.47% 19 Missing and 4 partials ⚠️
compass/plugin/registry.py 62.50% 4 Missing and 2 partials ⚠️
compass/scripts/process.py 14.28% 6 Missing ⚠️

❌ Your patch status has failed because the patch coverage (60.64%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #377      +/-   ##
==========================================
+ Coverage   56.63%   57.03%   +0.40%     
==========================================
  Files          55       56       +1     
  Lines        4953     4955       +2     
  Branches      431      447      +16     
==========================================
+ Hits         2805     2826      +21     
+ Misses       2120     2086      -34     
- Partials       28       43      +15     
Flag Coverage Δ
unittests 57.03% <60.64%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR advances COMPASS’s plugin architecture by introducing a centralized plugin registry, refactoring ordinance plugins into more generic base classes, and enabling prompt-driven collector/extractor implementations to reduce duplicated extraction logic across technologies.

Changes:

  • Added a plugin registry (PLUGIN_REGISTRY + register_plugin) and migrated the processing runner to resolve plugins via the registry.
  • Refactored ordinance plugin framework to support prompt-chain collectors/extractors and centralized configuration/validation.
  • Updated threaded cleaned-text writing to be driven by per-plugin file output registration, and adjusted unit tests/docs accordingly.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
compass/plugin/registry.py Introduces plugin registration and the global plugin registry used by the runner.
compass/plugin/ordinance.py Adds generalized ordinance plugin base + prompt-driven collector/extractor implementations; registers cleaned output filenames.
compass/plugin/interface.py Renames/splits plugin base responsibilities (filtered pipeline base separated from ordinance-specific parsing).
compass/plugin/base.py Adds JURISDICTION_DATA_FP hook and a base validate_plugin_configuration entrypoint.
compass/plugin/__init__.py Re-exports new plugin framework symbols and registry utilities.
compass/scripts/process.py Switches from hardcoded extractor registry to PLUGIN_REGISTRY for tech→plugin resolution.
compass/services/threaded.py Makes cleaned text outputs configurable via CLEANED_FP_REGISTRY keyed by plugin tech.
compass/validation/content.py Extends chunk-validation callback signature to support prompt-driven validation calls.
compass/utilities/jurisdictions.py Removes TX water districts CSV from default registry (now added via plugin registration).
compass/extraction/wind/plugin.py Migrates wind plugin to OrdinanceExtractionPlugin and registers it.
compass/extraction/wind/ordinance.py Converts wind ordinance collectors/extractors to prompt-driven implementations.
compass/extraction/solar/plugin.py Migrates solar plugin to OrdinanceExtractionPlugin and registers it.
compass/extraction/solar/ordinance.py Converts solar ordinance collectors/extractors to prompt-driven implementations.
compass/extraction/small_wind/plugin.py Migrates small-wind plugin to OrdinanceExtractionPlugin and registers it.
compass/extraction/small_wind/ordinance.py Converts small-wind ordinance collectors/extractors to prompt-driven implementations.
compass/extraction/water/plugin.py Registers the TX water rights plugin and supplies its jurisdiction dataset path.
compass/extraction/__init__.py Temporarily imports plugins to force registration via side effects.
compass/__init__.py Temporarily imports plugins at package import time to force registration.
docs/source/conf.py Updates Sphinx crossrefs and adds nitpick ignores for moved/changed symbols.
tests/python/unit/services/test_services_threaded.py Updates cleaned-file writer tests for the new registry-driven output behavior.
tests/python/unit/plugin/test_plugin_ordinances.py Updates ordinance plugin validation tests for the new ordinance plugin base classes.

@ppinchuk ppinchuk merged commit b44c642 into main Feb 7, 2026
18 checks passed
@ppinchuk ppinchuk deleted the pp/ordinance_plugin branch February 7, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Update to logic or general code improvements p-critical Priority: critical refactor Code improvements that do not change functionality topic-python-general Issues/pull requests related to python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants